package com.hermes.comics.extractors;

public class WebExtractorBuilder {

  private WebExtractorBuilder() {
  }

  public static boolean canBuild(String url) {
    return url.startsWith("http://www.guiadosquadrinhos.com/edicao") ||
        url.startsWith("http://guiadosquadrinhos.com/edicao") ||
        url.startsWith("http://www.goodreads.com") ||
        url.startsWith("http://dc.wikia.com") ||
        url.startsWith("http://marvel.wikia.com");
  }

  public static WebExtractor build(String url, String content) {
    if (url.startsWith("http://www.guiadosquadrinhos.com/edicao") || url.startsWith("http://guiadosquadrinhos.com/edicao")) {
      return new GuiaDosQuadrinhosExtractor(url, content);
    } else if (url.startsWith("http://www.goodreads.com")) {
      return new GoodReadsExtractor(url, content);
    } else if (url.startsWith("http://dc.wikia.com")) {
      return new WikiaDcExtractor(url, content);
    } else if (url.startsWith("http://marvel.wikia.com")) {
      return new WikiaMarvelExtractor(url, content);
    } else {
      return null;
    }
  }

}
